package com.SweetWhite.UserManagement.model.controller;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.SweetWhite.UserManagement.model.bean.Hero_User;
import com.SweetWhite.UserManagement.model.service.SelectService;
import com.alibaba.fastjson.JSON;

//模糊查询
@Controller
@CrossOrigin(origins="*", maxAge=3600)
public class GetByNameController {
	@Autowired
	private SelectService service;
@RequestMapping("getByName")
@ResponseBody
public String getByName(String name) {
	name="%"+name+"%";
	List<Hero_User> list=new ArrayList<Hero_User>();
	list =service.getByName(name);
	String l =JSON.toJSONString(list);
	return l;
	
}
}
